package com.project.service.imp;

import com.project.bean.CutPageBean;
import com.project.bean.ProductBean;
import com.project.dao.IProductDao;
import com.project.dao.imp.ProductDaoImp;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;

@Service
public class ProductServiceImp implements IProductService {
    @Autowired
    private IProductDao dao;

    @Override
    public CutPageBean<ProductBean> findByItem(int pageNO, String name, LocalDate startDate, LocalDate endDate) {
        return dao.findByItem(pageNO, name, startDate, endDate);
    }

    @Override
    public ProductBean findById(Integer id) {
        return dao.findById(id);
    }

    @Override
    public void update(Integer id, Integer price) {
        dao.update(id, price);
    }

    @Override
    public void del(Integer id) {
        dao.del(id);
    }
}
